$(function(){
	$(".mc").css("display","none");
	$('#categorys').hover(function(){
		$(this).children('.mc').toggle();
	});
	$Base.isLogin(location.href, getCommentList);
});

function getCommentList() {
	var url = '/json?action=QUERY_T_PRODUCT_COMMENT_PAGERBY_MEMBER_ACTION';
	var pageSize = 10;
	var defaultHtml = '<tr><td colspan="4">没有您的评论信息...</td></tr>';
	var current = $Util.getQueryString(document.location.search,'current');
	$UI.changePage(url,pageSize,'T_PRODUCT_COMMENT','#comment_list',printComment,'#pager',defaultHtml,current,'#topPagePanel');
}

function printComment(obj,result,i,n,len,c,t) {
	if (t) {
		$('#totalProducts').html('共<strong>'+t+'</strong>个商品');
		$('#pageShow').html(c+'/'+(Math.floor(t/25)+1));
	}
	var div = [
		'<tr>',
			'<td style="padding-left:20px;" width="30%">',
			'<div class="fl"><a href="../product/file.html?id=',obj.PRODUCT_ID,'" target="blank"><img src="../upload/product/',obj.PRODUCT_NO,'.jpg" align="top" width="50" height="50" style="border:1px solid #E9E9E9;"/></a></div>',
			'<div class="fl" style="margin-left:5px;"><a href="../product/file.html?id='+obj.PRODUCT_ID+'"  target="blank">',obj.PRODUCT_NAME,'</a></div>',
			'</td>',
			'<td width="45%">',obj.COMMENT_TEXT,'</td>',
			'<td width="5%">',obj.SCORE,'</td>',
			'<td width="10%">',$Base.getVerifyStatus(obj.IS_PASS),'</td>',
			'<td width="10%">',$Util.toChar(obj.COMMENT_DATE,'yyyy-mm-dd hh24:mi:ss'),'</td>',
		'</tr>'
	].join('');		
	$(result).append(div);
}